package hession.model;

import java.io.Serializable;
import java.util.IdentityHashMap;

public class LuceneDocument implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public float score;

	/**
	 * A hit document's number.
	 * 
	 * @see IndexSearcher#doc(int)
	 */
	public int doc;

	/** Only set by {@link TopDocs#merge} */
	public int shardIndex;

	public IdentityHashMap<String, String> fields = new IdentityHashMap<String, String>();

	public LuceneDocument(int doc, float score, int shardIndex) {
		this.doc = doc;
		this.score = score;
		this.shardIndex = shardIndex;
	}

	@Override
	public String toString() {
		return "{doc:" + doc + ", score:" + score + ", shardIndex:" + shardIndex + ", fields:" + fields + "}";
	}
}
